<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import="com.yaodian100.core.common.utils.ServerValue"%>       
    <%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="pu" uri="/WEB-INF/tld/pageutil.tld" %>
<%@taglib prefix="mu" uri="/WEB-INF/tld/mallutil.tld" %>
<%@taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jstl/core_rt" prefix="c-rt"%>
<%@taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt-rt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib uri="/WEB-INF/tld/importTag.tld" prefix="import" %>
<style> 
.promo-popup{padding:10px;*padding:10px 0 10px 8px; color:#666;line-height:1.4em; }
.promo-popup h2,.promo-popup h3{font-size:15px;color:#d12e6f; margin-bottom:.8em;}
.promo-popup h3{color:#666;}
.promo-popup p{margin:.5em 0;}
.promo-popup .d-line{background:url(/images/link_dote.gif) repeat-x scroll 0 50%; padding:1px 0;}
.promo-popup ol,.promo-popup ul{margin-bottom:1em;margin-left:2em;}
.promo-popup li{list-style:decimal;}
</style>
<script src="/js/pageable.js"></script>
${pu:reqSet('order', pu:get('com.yaodian100.ec.order.entity.Orders', param.orderId)) }
<script>
$(function(){ 
	$('#current_location').html(' > 修改发票讯息');
}); 
</script>
<c-rt:if test="${order.memberId==mu:memberId()}">

<script>
$().ready(function(){
	$("#chkPayType").dialog({
		bgiframe: true,
		autoOpen: false,
		height: 200,
		width:400,
		modal: true
	});	
	$("#chkOK").click(function(){
		$("#chkPayType").dialog('close');
	});
	//发票信息
	$("#invotype02").attr("checked",true); 
			$("#invoTitle").show();
	$('#invotype01').click(function(){
		$("#invoTitle").val("");
		$("#invoTitle").hide();
	});
	$('#invotype02').click(function(){
		$("#invoTitle").show();
	});
	
	$("#go_next").click(function() {
		if($("#invoTitle").val().length+chineseCount($("#invoTitle").val())>40){
    		alert("请使用 中文20个字以内 或 英文40个字以内");
         	return false;
	    }
		if ($('#invotype02').is(":checked") == true && $("#invoTitle").val()=="" ){
			$('#chkPayType').dialog('destroy');
			$('#chkPayType').dialog({
				closeOnEscape: false,
				open: function(event, ui) { $(".ui-dialog-titlebar-close").hide(); },
				bgiframe: true,
				width:380,
				modal: true
			});
			return false;
		}else{
			$("#modInvoiceForm").submit();
			return false;
		}	
	});

});
function chineseCount(word){
    var length=0;
    for(var cc=0;cc<word.length;cc++){
       var c = word.charCodeAt(cc);
      if (!(c>=32&&c<=126)) length++;
    }
    return length;
}
</script>
<s:form action="orderMod/modInvoiceExt.do" id="modInvoiceForm" name="modInvoiceForm" method="post">
<input type="hidden" name="orderId" value="${order.orderId}"/>
  <!-- content start -->
  <div class="content order-modify">
      <h2>修改发票讯息</h2>
	      <div class="d-show">
	        <p><strong>当前发票抬头：</strong>${order.invoiceTp=='01'?"个人":order.invoiceTitle}</p>
	        
	        
	        <p class="c-f" style="border-bottom:1px solid #ccc; height:10px; margin:15px 0;">&nbsp;</p>
	        <p ><strong>变更发票抬头：</strong></p>
	         		<div id="showMessage">
	                    <table width="80%" border="0" cellspacing="0" cellpadding="0" id="paytb" >
		                        <tr >
		                          <td><strong>
		                          	<input id="invotype01" name="invotype" type="radio" value="01" ${order.invoiceTp=='01'?" checked='checked'":""}>  <strong>个人</strong>
				 					<input id="invotype02" name="invotype" type="radio" value="02" ${order.invoiceTp=='02'?" checked='checked'":""}>  <strong>单位</strong> 
				 					<input size="20" type="text" name="invoTitle" id="invoTitle" value="${order.invoiceTitle}" maxlength="40"/>   <span class="txt-gy">(20个字内)</span>
		                          </strong></td>
		                        </tr>
	                      </table>
	             </div>
	        <p class="c-f" align="center"><br />
	        
	        <a id="go_next"  href="javascript:;" class="btn-mid">继续</a> 
	        <a href="<%=ServerValue.getFrontContextPath()%>/member/order/page.do?page=detail&orderId=${order.orderId}" class="btn-mid">回订单页</a>
	        </p>
	      </div>
	   
  </div>
  </s:form>
</c-rt:if>
<c-rt:if test="${order.memberId!=mu:memberId()}">
您无权查看本订单
</c-rt:if>
<div id="dialog"></div>
<DIV id="chkPayType" title="请输入单位抬头" class="alert-caution" style="display: none;">
         <p>请输入单位抬头。</p>
         <div align="center"><a href="javascript:;"  id="chkOK" class="btn-mid" onfocus="blur()">确定</a></div>

</DIV>

